﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace DisplayTime
{
    class Program
    {
        static void Main(string[] args)
        {
            int hours, minutes, seconds;

            Console.WriteLine("Please, input time (hours):");
            hours = Convert.ToInt32(Console.ReadLine());
            if (hours < 0 && hours > 23)
            {
                Console.WriteLine("Invalid time format");
                return;
            }

            Console.WriteLine("Please, input time (minutes):");
            minutes = Convert.ToInt32(Console.ReadLine());
            if (minutes < 0 && minutes > 59)
            {
                Console.WriteLine("Invalid time format");
                return;
            }

            Console.WriteLine("Please, input time (seconds):");
            seconds = Convert.ToInt32(Console.ReadLine());
            if (seconds < 0 && seconds > 23)
            {
                Console.WriteLine("Invalid time format");
                return;
            }

            for (; ;)
            {
                Console.WriteLine("{0:00}:{1:00}:{2:00}", hours,minutes,seconds);
                seconds++;
                
              //  minutes++;
               // hours++;
                Thread.Sleep(1000);
                Console.Clear();

                if (seconds == 60)
                {
                    seconds = 0;
                }
               if (seconds == 0)
                {
                    minutes++;
                }
                    if (minutes == 60)
                    {
                        minutes = 0;
                    hours++;
                    }

                if (hours == 24)
                {
                    hours = 0;
                }
            }
        }
    }
}
